import request from '@/utils/request'

export function deviceList(page) {
  return request({
    url: '/web/device/list',
    method: 'get',
    params: page
  })
}

export function deviceInfo(sn) {
  return request({
    url: '/web/device/info',
    method: 'get',
    params: { sn }
  })
}

export function devicePositionList() {
  return request({
    url: '/web/device/position/list',
    method: 'get'
  })
}

export function deviceEdit(form) {
  return request({
    url: '/web/device/edit',
    method: 'get',
    params: form
  })
}

export function deviceOnlineLogList(page) {
  return request({
    url: '/web/device/online/log/list',
    method: 'get',
    params: page
  })
}

export function devicePowerLogList(page) {
  return request({
    url: '/web/device/power/log/list',
    method: 'get',
    params: page
  })
}

export function deviceOperateLogList(page) {
  return request({
    url: '/web/device/operate/log/list',
    method: 'get',
    params: page
  })
}

export function deviceClockList(sn, number) {
  return request({
    url: '/web/device/clock/list',
    method: 'get',
    params: { sn, number }
  })
}

export function deviceClockAdd(form) {
  return request({
    url: '/web/device/clock/add',
    method: 'get',
    params: form
  })
}

export function deviceClockEdit(form) {
  return request({
    url: '/web/device/clock/edit',
    method: 'get',
    params: form
  })
}

export function deviceClockDelete(id) {
  return request({
    url: '/web/device/clock/delete',
    method: 'get',
    params: { id }
  })
}
